﻿using System;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;
using Business;
using Business.Forms;
using DevExpress.LookAndFeel;
using Ecf;
using Ecf.Enum;
using Ecf.Forms;

namespace Vendas
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                DevExpress.Skins.SkinManager.EnableFormSkins();
                DevExpress.UserSkins.BonusSkins.Register();
                UserLookAndFeel.Default.SetSkinStyle(Properties.Settings.Default.SkinName);
                DevExpress.Utils.AppearanceObject.DefaultFont = new Font("Tahoma", 11);

                using (var log = new FormLogin())
                {
                    log.MostraOpcoesVenda();

                    log.Activated += log_Activated;
                    log.ShowDialog();

                    if (log.AcessarMenuFiscal())
                    {

                        Application.Run(new FormMenuFiscal(FormMenuFiscal.MenuFiscalTipo.Restaurante));
                    }
                    else
                        Application.Run(new VendasRestaurante());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro ao iniciar aplicação.\n" + ex.Message);
            }
            
        }

        static void log_Activated(object sender, EventArgs e)
        {
            
        }

    }
}